#pragma once

#include "Common/EffectDefine.h"
#include "base/core/singleton.h"

class Creature;
struct EffectEffectCfgInfo;

//效果基础类
class IEffect
{
public:
	IEffect(){};
	virtual ~IEffect(){};

	virtual int8_t EffectType() = 0;

	virtual int32_t OnEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg) = 0;
	virtual int32_t RemoveEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg) = 0;
};

//BUFF类效果
class EffectAddBuff : public IEffect
{
public:
	EffectAddBuff(){};
	virtual ~EffectAddBuff(){};

	virtual int8_t EffectType() { return (int8_t)EEffectFuncType::EEffectFuncType_Buff; }

	virtual int32_t OnEffect(Creature *pCreature, const EffectEffectCfgInfo* pEffectCfg);
	virtual int32_t RemoveEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg);
};

//触发任务类效果
class EffectTriggerMission : public IEffect
{
public:
	EffectTriggerMission(){};
	virtual ~EffectTriggerMission(){};

	virtual int8_t EffectType() { return (int8_t)EEffectFuncType::EEffectFuncType_Mission; }

	virtual int32_t OnEffect(Creature *pCreature, const EffectEffectCfgInfo* pEffectCfg);
	virtual int32_t RemoveEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg);
};

//触发任务类效果
class EffectTriggerRefreshMonster : public IEffect
{
public:
	EffectTriggerRefreshMonster(){};
	virtual ~EffectTriggerRefreshMonster(){};

	virtual int8_t EffectType() { return (int8_t)EEffectFuncType::EEffectFuncType_RefreshMonst; }

	virtual int32_t OnEffect(Creature *pCreature, const EffectEffectCfgInfo* pEffectCfg);
	virtual int32_t RemoveEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg);
};
//触发生成采集物
class EffectTriggerRefreshCollect : public IEffect
{
public:
	EffectTriggerRefreshCollect(){};
	virtual ~EffectTriggerRefreshCollect(){};

	virtual int8_t EffectType() { return (int8_t)EEffectFuncType::EEffectFuncType_Collect; }

	virtual int32_t OnEffect(Creature *pCreature, const EffectEffectCfgInfo* pEffectCfg);
	virtual int32_t RemoveEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg);
};

//触发位面
class EffectTriggerRefreshPlane : public IEffect
{
public:
	EffectTriggerRefreshPlane(){};
	virtual ~EffectTriggerRefreshPlane(){};

	virtual int8_t EffectType() { return (int8_t)EEffectFuncType::EEffectFuncType_Plane; }

	virtual int32_t OnEffect(Creature *pCreature, const EffectEffectCfgInfo* pEffectCfg);
	virtual int32_t RemoveEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg);
};

//传送
class EffectTriggerTrance : public IEffect
{
public:
	EffectTriggerTrance(){};
	virtual ~EffectTriggerTrance(){};

	virtual int8_t EffectType() { return (int8_t)EEffectFuncType::EEffectFuncType_Trance; }

	virtual int32_t OnEffect(Creature *pCreature, const EffectEffectCfgInfo* pEffectCfg);
	virtual int32_t RemoveEffect(Creature* pCreature, const EffectEffectCfgInfo* pEffectCfg);
};